//
// Created by LH on 2017/8/29.
//
#include <iostream>
#include <stdio.h>
#include <stack>
using namespace std;

stack<char> s;

int main()
{
    char c='1';
    while ((c = getchar()) && c != '@')
    {
        if (c == '(')
            s.push('C');
        if (c == ')')
            s.pop();
    }
    if (s.empty())
    {
        cout << "YES";
    }
    else
    {
        cout << "NO";
    }
    return 0;
}